package com.example.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.dto.CouponFormDTO;
import com.example.dto.CouponIssueFormDTO;
import com.example.entity.Coupon;
import com.example.vo.CouponVO;
import com.example.vo.Result;
import com.example.vo.buyer.DiscountDetailVo;

import java.time.LocalDateTime;
import java.util.List;

/**
* @author circle48
* @description 针对表【coupon(优惠券表)】的数据库操作Service
* @createDate 2024-05-17 14:37:16
*/
public interface CouponService extends IService<Coupon> {

    Result<IPage<CouponVO>> getCouponList(Integer pageNum, Integer pageSize);


    boolean saveDiscountDetails(Long userId, List<DiscountDetailVo> discountDetails);

    boolean clearDiscountDetails(Long userId);

    Result issueCoupon(CouponIssueFormDTO dto);

    void updateUseCount(Long couponId);

    Result addCoupon(CouponFormDTO dto);

    Result<IPage<Coupon>> queryPage(Integer pageNum, Integer pageSize);


    void updateStatusToStart(LocalDateTime now);




    Result<IPage<Coupon>> queryMyStorePage(Integer pageNum, Integer pageSize, Long storeId, Integer couponCategory, Integer couponStatus, String couponName);

    Result<IPage<Coupon>> getAllCouponList(Integer pageNum, Integer pageSize, Integer couponCategory, Integer couponStatus, String couponName);

    List<Coupon> getListByIds(List<Long> couponIds);


    void updateStatusToPending(LocalDateTime now);



    void updateStatusToEnded(LocalDateTime now);

    void updateStatusToExpired(LocalDateTime now);
}
